package com.sike.netty.rumen.shizhan_ai.common;

import io.netty.channel.Channel;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class ChannelSessionMemory {

    private final static Map<String, Channel> clientChannelMap = new ConcurrentHashMap<>();

    /**
     * 保存客户端 Channel
     * @param key
     * @param channel
     */
    public static void putClientChannel(String key,Channel channel) {
       clientChannelMap.put(key,channel);
    }

    /**
     * 获取客户端 Channel
     * @param key
     * @return
     */
    public static Channel getClientChannel(String key) {
        return clientChannelMap.get(key);
    }
}

